home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / powerb5.zip / P5WPR007.TIP < prev    next >
Text File  |  1993-06-01  |  2KB  |  65 lines

  1. One of my favorite WordPerfect tricks lets me use the length
  2. of a document, in pages, in a macro. This is useful if you
  3. want to put a statement such as "Page x of y" in a header or
  4. footer, or if you need to know the size of the document
  5. you'll be faxing or sending via an expensive courier.
  6.  
  7. The trick involves a macro that goes to the bottom of the
  8. file, saves the page number as a variable, then does
  9. something useful with the variable. As an example, I've
  10. included a macro that creates a footer that lists the
  11. current page number and the total number of pages. If you
  12. run the macro just before you print, the number will be
  13. accurate.
  14.  
  15. Neville G. Weekes
  16. Boston, Massachusetts
  17.  
  18. Editor's Note: This is an incredibly useful tip if you want
  19. to ensure that readers don't mistake a partial document for
  20. a complete one. What's more, you can easily adapt the macro
  21. to other jobs, like adding a page count to a fax cover
  22. sheet. It can even help if you're sending hard copy through
  23. the post office: If you know approximately how much your
  24. stationery weighs, you can write a macro that computes how
  25. much postage you'll need to mail it.
  26.  
  27. Mr Weekes' macro, which creates a footer which says "Page X
  28. of Y," must normally be entered via the WordPerfect macro
  29. editor, but you don't need to do that; the macro is present
  30. on your PowerBase *.* Volume 5 diskette as the file
  31. P5WPR\ALTP.WPM.
  32.  
  33. The text of the macro is shown below for reference.
  34.  
  35. {DISPLAY OFF}
  36. {Home}{Home}{Home}{Down}
  37. {ASSIGN}LastPage~{SYSTEM}Page~~
  38. {Goto}{Goto}
  39. {ON NOT FOUND}{GO}Top~~
  40.  
  41. {Search Left}{Format}PFA{Search}
  42. {IF}{STATE}&512~
  43.    {Backspace}
  44. {ELSE}
  45.    {Backspace}Y
  46. {END IF}
  47. {GO}MakeFoot~
  48.  
  49. {LABEL}Top~
  50. {Home}{Home}{Home}{Up}
  51.  
  52. {LABEL}MakeFoot~
  53. {Format}PFAP
  54. Page {^B} of {VARIABLE}LastPage~
  55. {Exit}{Exit}
  56. {Goto}{Goto}
  57.  
  58.  
  59. Title: Getting to the Bottom of WP
  60. Category: WPR
  61. Issue Date: November, 1992
  62. Editor: Brett Glass
  63. Supplementary Files: P5WPR\ALTP.WPM
  64. Filename: P5WPR007.TIP
  65.